$("#loginBtn").click(function() {
	var userId = $.trim($('#userId').val());
	var password = $.trim($("#password").val());
	if (userId == "" || password == "") {
		$('#error').text('请输入账户名和密码').show();
		return;
	} else {
		$.ajax({
			type: "POST",
			url : localhost + "user/login",
			dataType : "jsonp",
			data : {
				id : userId,
				password : password
			},
			jsonp : "jsonpCallback",
			success : function(data) {
				if (data == -1) {
					$("#error").html("账号不对");
				} else if( data == -2){
					$("#error").html("密码不对");
				}else{
					window.location.href = "index.shtml";
				}
			}
		});
	}
});
